# -*- coding = utf-8 -*-
# @Time : 2021/7/16 9:22
# @Author : 龙王赘婿_彪少
# @File : testSqlite2.py
# @Software: PyCharm

import sqlite3

conn = sqlite3.connect("test.db")

print("成功打开数据库")

c = conn.cursor()

sql = "select id, name, address, salary from company"
# 执行SQL语句
cursor = c.execute(sql)

for row in cursor:
    print("id = ", row[0])
    print("name = ", row[1])
    print("address", row[2])
    print("salary = ", row[3], "\n")
# 关闭
conn.close()

print("插入")